//package org.jeecg.modules.zcgl.job;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import lombok.extern.slf4j.Slf4j;
//import org.jeecg.common.util.DateUtils;
//import org.jeecg.modules.zcgl.entity.ReceivablesInfo;
//import org.jeecg.modules.zcgl.enums.PayStatusEnum;
//import org.jeecg.modules.zcgl.service.IReceivablesInfoService;
//import org.jeecg.modules.zcgl.tencent.service.IWxSendMessageService;
//import org.quartz.Job;
//import org.quartz.JobExecutionContext;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//
//import java.util.Date;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 查询删除前一天的未支付的订单
// */
//@Slf4j
//public class DeleteOrderJob implements Job {
//
//
//	@Autowired
//	private IWxSendMessageService sendMessageService;
//	@Autowired
//	private IReceivablesInfoService receivablesInfoService;
//	@Value("${weChat.notice_date_no:3}")
//	private Integer noticeDateNo;
//
//	@Override
//	public void execute(JobExecutionContext jobExecutionContext) {
//		long start = System.currentTimeMillis();
//		log.info("缴费提醒开始：" + start);
//        LambdaQueryWrapper<ReceivablesInfo> queryWrapper = new LambdaQueryWrapper<>();
//        queryWrapper.eq(ReceivablesInfo :: getPayStatus, PayStatusEnum.UNPAID.getStatus());
//		Date date = DateUtils.nextDay(noticeDateNo);
//		Map<String, Object> param = new HashMap<>();
//		param.put("startTime", date);
//
//        List<String> receivablesIds = receivablesInfoService.queryIdList(queryWrapper, param);
//        if (receivablesIds != null && receivablesIds.size() > 0){
//        	receivablesIds.stream().forEach(receivablesId -> {
//				sendMessageService.paymentReminder(receivablesId);
//			});
//			log.info("共计：" + receivablesIds.size() + "条数据。");
//		}
//		long end = System.currentTimeMillis();
//		log.info("缴费提醒结束：" + end);
//		log.info("缴费提醒耗时：" + (end-start)/1000 + "S");
//	}
//}
